extends "../fuchou-3/fuchou-3.gd"


var baseId = ""
var upText1 = "余威赋予的活力层数+3"
var upText2 = "馈赠将额外赋予目标自身血上限"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("彻底死亡后，将自身的双攻60%赋予当前三维最高的友军(排除召唤物，不能重复馈赠同一角色)", "馈赠")

func upgrade():
	.upgrade()
	if upgraded == 1:
		p3 = 6
		
func _onCharaDel(cha):
	._onCharaDel(cha)
	if not is_instance_valid(cha):return
	if cha == self:
		var chas = getAllChas(2)
		chas.sort_custom(sys, "sortBySwDesc")
		for i in chas:
			if i.hasBuff("b_fuchou4") == null and i.ename != "fuchou":
				castBuff(i, b_fuchou4.new(att.atk, att.mgiAtk))
				break

class b_fuchou4:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init(atk, mgiAtk):
		attInit()
		id = "b_fuchou4"
		att.atk = atk*0.6
		att.mgiAtk = mgiAtk*0.6
		buffName = "馈赠"
		dispel = 2
	func _connect():
		if casCha.upgraded == 2:
			att.maxHp = casCha.att.maxHp*0.6
			